package A;

import java.util.ArrayList;
import java.util.List;

public class Test_11 {
    public static void main(String[] args) {
        int oldArr[] = {1, 3, 4, 5, 0, 0, 6, 6, 0, 5, 4, 7, 6, 7, 0, 5};
        List<Integer> list = new ArrayList<>();
        for (int i : oldArr) {
            if (i != 0) {
                list.add(i);
            }
        }
        int[] newArr = new int[list.size()];
        for (int i = 0; i < list.size(); i++) {
            newArr[i] = list.get(i);
        }
    }
}
